

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>使用 QAT 为加密和压缩提速 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Ceph s3 select" href="../s3select/" />
    <link rel="prev" title="radosgw-admin -- rados REST 网关的用户管理工具" href="../../man/8/radosgw-admin/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 对象网关</a></li>
      <li class="breadcrumb-item active">使用 QAT 为加密和压缩提速</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/radosgw/qat-accel.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 对象网关</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../frontends/">HTTP 前端</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite/">多站配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../zone-features/">域的功能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../placement/">存储池归置与存储类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite-sync-policy/">多站同步策略配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../pools/">存储池的配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../config-ref/">配置参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/">管理指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../account/">用户账户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3/">S3 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iam/">IAM API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw-cache/">数据缓存和 CDN</a></li>
<li class="toctree-l2"><a class="reference internal" href="../swift/">Swift API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../adminops/">管理操作 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/">Python 接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">通过 NFS 导出</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keystone/">与 OpenStack Keystone 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../barbican/">与 OpenStack Barbican 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vault/">与 HashiCorp Vault 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../kmip/">与 KMIP 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../opa/">与 Open Policy Agent 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multitenancy/">多租户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../compression/">压缩</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ldap-auth/">LDAP 认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../encryption/">服务器端加密</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucketpolicy/">桶策略</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dynamicresharding/">动态的桶索引重分片</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mfa/">多因子认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sync-modules/">同步模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../notifications/">Bucket Notifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../layout/">RADOS 中的数据布局</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STS/">STS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STSLite/">STS Lite</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keycloak/">Keycloak</a></li>
<li class="toctree-l2"><a class="reference internal" href="../session-tags/">Session Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="../role/">Role</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orphans/">Orphan List and Associated Tooliing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oidc/">OpenID Connect Provider</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw/">radosgw 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw-admin/">radosgw-admin 手册页</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">使用 QAT 为加密和压缩提速</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#qat-in-the-software-stack">QAT in the Software Stack</a></li>
<li class="toctree-l3"><a class="reference internal" href="#qat-environment-setup">QAT Environment Setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="#implementation">Implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#configuration">Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-reference">CONFIG REFERENCE</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../s3select/">S3-select</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lua-scripting/">Lua Scripting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../d3n_datacache/">D3N Data Cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cloud-transition/">Cloud Transition</a></li>
<li class="toctree-l2"><a class="reference internal" href="../metrics/">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../uadk-accel/">UADK Acceleration for Compression</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucket_logging/">桶的日志记录</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="qat">
<h1>使用 QAT 为加密和压缩提速<a class="headerlink" href="#qat" title="Permalink to this heading"></a></h1>
<p>Intel QAT (QuickAssist Technology) can provide extended accelerated encryption
and compression services by offloading the actual encryption and compression
request(s) to the hardware QuickAssist accelerators, which are more efficient
in terms of cost and power than general purpose CPUs for those specific
compute-intensive workloads.</p>
<p>See <a class="reference external" href="https://github.com/ceph/ceph/pull/19714">QAT Support for Compression</a> and <a class="reference external" href="https://github.com/ceph/ceph/pull/19386">QAT based Encryption for RGW</a>.</p>
<section id="qat-in-the-software-stack">
<h2>QAT in the Software Stack<a class="headerlink" href="#qat-in-the-software-stack" title="Permalink to this heading"></a></h2>
<p>Application developers can access QuickAssist features through the QAT API.
The QAT API is the top-level API for QuickAssist technology, and enables easy
interfacing between the customer application and the QuickAssist acceleration
driver.</p>
<p>The QAT API accesses the QuickAssist driver, which in turn drives the
QuickAssist Accelerator hardware. The QuickAssist driver is responsible for
exposing the acceleration services to the application software.</p>
<p>A user can write directly to the QAT API, or the use of QAT can be done via
frameworks that have been enabled by others including Intel (for example, zlib*,
OpenSSL* libcrypto*, and the Linux* Kernel Crypto Framework).</p>
</section>
<section id="qat-environment-setup">
<h2>QAT Environment Setup<a class="headerlink" href="#qat-environment-setup" title="Permalink to this heading"></a></h2>
<ol class="arabic simple">
<li><p>QuickAssist Accelerator hardware is necessary to make use of accelerated
encryption and compression services. And QAT driver in kernel space have to
be loaded to drive the hardware.</p></li>
</ol>
<p>The out-of-tree QAT driver package can be downloaded from <a class="reference external" href="https://01.org/intel-quickassist-technology">Intel Quickassist
Technology</a>.</p>
<p>The QATlib can be downloaded from <a class="reference external" href="https://github.com/intel/qatlib">qatlib</a>, which is used for the in-tree QAT
driver.</p>
<blockquote>
<div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>The out-of-tree QAT driver is gradually being migrated to an in-tree driver+QATlib.</p>
</div>
</div></blockquote>
<ol class="arabic simple" start="2">
<li><p>The implementation of QAT-based encryption is directly based on the QAT API,
which is included the driver package. However, QAT support for compression
depends on the QATzip project, which is a userspace library that builds on
top of the QAT API. At the time of writing (July 2024), QATzip speeds up
gzip compression and decompression.</p></li>
</ol>
<p>See <a class="reference external" href="https://github.com/intel/QATzip">QATzip</a>.</p>
</section>
<section id="implementation">
<h2>Implementation<a class="headerlink" href="#implementation" title="Permalink to this heading"></a></h2>
<ol class="arabic simple">
<li><p>QAT based Encryption for RGW</p></li>
</ol>
<p><a class="reference external" href="https://github.com/ceph/ceph/pull/15168">OpenSSL support for RGW encryption</a> has been merged into Ceph, and Intel also
provides one <a class="reference external" href="https://github.com/intel/QAT_Engine">QAT Engine</a> for OpenSSL. Theoretically, QAT-based encryption in
Ceph can be directly supported through the OpenSSl+QAT Engine.</p>
<p>However, the QAT Engine for OpenSSL currently supports only chained operations,
which means that Ceph will not be able to utilize QAT hardware features for
crypto operations based on the OpenSSL crypto plugin. As a result, one QAT plugin
based on native QAT API is added into the crypto framework.</p>
<ol class="arabic simple" start="2">
<li><p>QAT Support for Compression</p></li>
</ol>
<p>As mentioned above, QAT support for compression is based on the QATzip library
in user space, which is designed to take full advantage of the performance that
QuickAssist Technology provides. Unlike QAT-based encryption, QAT-based
compression is supported through a tool class for QAT acceleration rather than
a compressor plugin. This common tool class can transparently accelerate the
existing compression types, but only the zlib compressor is supported at the
time of writing. This means that this tool class can be used to speed up
the zlib compressor if QAT hardware is available.</p>
</section>
<section id="configuration">
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this heading"></a></h2>
<ol class="arabic">
<li><p>Prerequisites</p>
<p><strong>For out-of-tree QAT</strong></p>
<p>Make sure the out-of-tree QAT driver with version v1.7.L.4.14.0 or higher
has been installed.  Remember to set an environment variable <code class="docutils literal notranslate"><span class="pre">ICP_ROOT</span></code>
for your QAT driver package root directory.</p>
<p>To enable the QAT based encryption and compression, the user must modify the
QAT configuration files. For example, for the Intel QuickAssist Adapter 8970
product, revise <code class="docutils literal notranslate"><span class="pre">c6xx_dev0/1/2.conf</span></code> in the directory <code class="docutils literal notranslate"><span class="pre">/etc/</span></code> and keep them
the same. For example:</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="c1">#...</span>
<span class="c1"># User Process Instance Section</span>
<span class="c1">##############################################</span>
<span class="k">[CEPH]</span>
<span class="na">NumberCyInstances</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">1</span>
<span class="na">NumberDcInstances</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">1</span>
<span class="na">NumProcesses</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">8</span>
<span class="na">LimitDevAccess</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">1</span>
<span class="c1"># Crypto - User instance #0</span>
<span class="na">Cy0Name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;SSL0&quot;</span>
<span class="na">Cy0IsPolled</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">1</span>
<span class="c1"># List of core affinities</span>
<span class="na">Cy0CoreAffinity</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">0</span>

<span class="c1"># Data Compression - User instance #0</span>
<span class="na">Dc0Name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;Dc0&quot;</span>
<span class="na">Dc0IsPolled</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">1</span>
<span class="c1"># List of core affinities</span>
<span class="na">Dc0CoreAffinity</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">0</span>
</pre></div>
</div>
<p><strong>For in-tree QAT</strong></p>
<p>There are some prerequisites for using QATlib. Make sure that your system
meets the <a class="reference external" href="https://intel.github.io/quickassist/qatlib/requirements.html">QATlib System Requirements</a> .</p>
<ul>
<li><p>To properly use the QATlib library, the Intel VT-d and SR-IOV parameters
must be enabled in the platform BIOS.</p></li>
<li><p>Some QATlib features require a recent kernel driver or firmware version.
See <a class="reference external" href="https://intel.github.io/quickassist/RN/In-Tree/in_tree_firmware_RN.html#qat-kernel-driver-releases-features">QATlib Kernel Driver Releases</a>.</p></li>
<li><p>The supported platform contains a 4xxx Intel Communications device or
newer.</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">intel_iommu</span></code> parameter must be enabled. Verify that this setting is
enabled by running the following commands:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "$ ";
}
</style><span class="prompt1">cat<span class="w"> </span>/proc/cmdline<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span><span class="nv">intel_iommu</span><span class="o">=</span>on</span>
<span class="prompt1">sudo<span class="w"> </span>sh<span class="w"> </span>-c<span class="w"> </span><span class="s1">&#39;echo &quot;@qat - memlock 204800&quot; &gt;&gt; /etc/security/limits.conf&#39;</span></span>
<span class="prompt1">sudo<span class="w"> </span>su<span class="w"> </span>-l<span class="w"> </span><span class="nv">$USER</span></span>
</pre></div></div></li>
</ul>
<p>For configuration and Tuning see <a class="reference external" href="https://intel.github.io/quickassist/qatlib/configuration.html">QATlib Configuration and Tuning</a>.</p>
</li>
<li><p>QAT-based Encryption for RGW</p>
<p>The CMake option <code class="docutils literal notranslate"><span class="pre">WITH_QATDRV=ON</span></code> must be set. If you build Ceph from
source code (see: <a class="reference internal" href="../../install/build-ceph/#build-ceph"><span class="std std-ref">构建 Ceph</span></a>), navigate to your cloned Ceph repository
and execute the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1"><span class="nb">cd</span><span class="w"> </span>ceph</span>
<span class="prompt1">./do_cmake.sh<span class="w"> </span>-DWITH_QATDRV<span class="o">=</span>ON</span>
<span class="prompt1"><span class="nb">cd</span><span class="w"> </span>build</span>
<span class="prompt1">ininja</span>
</pre></div></div><div class="admonition note">
<p class="admonition-title">Note</p>
<p>The section name in QAT configuration files must be <code class="docutils literal notranslate"><span class="pre">CEPH</span></code>,
because the section name is set to <code class="docutils literal notranslate"><span class="pre">CEPH</span></code> in the Ceph crypto source code.</p>
</div>
<p>Edit the Ceph configuration file (usually <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code>) to make use of the
QAT-based crypto plugin:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">plugin</span> <span class="n">crypto</span> <span class="n">accelerator</span> <span class="o">=</span> <span class="n">crypto_qat</span>
</pre></div>
</div>
</li>
<li><p>QAT Support for Compression</p>
<p><strong>For out-of-tree QAT</strong></p>
<p>For the out-of-tree QAT driver package, before building ensure that both the QAT
driver and <a class="reference external" href="https://github.com/intel/QATzip">QATzip</a>  have been installed. In addition to <code class="docutils literal notranslate"><span class="pre">ICP_ROOT</span></code>,
set the environment variable <code class="docutils literal notranslate"><span class="pre">QZ_ROOT</span></code> to the root directory of your QATzip
source tree.</p>
<p>The following CMake options must be configured to trigger QAT-based
compression when building Ceph:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">./do_cmake.sh<span class="w"> </span>-DWITH_QATDRV<span class="o">=</span>ON<span class="w"> </span>-DWITH_QATZIP<span class="o">=</span>ON<span class="w"> </span>-DWITH_SYSTEM_QATZIP<span class="o">=</span>ON<span class="w"> </span>-DWITH_QATLIB<span class="o">=</span>OFF</span>
</pre></div></div><p>Set an environment variable to clarify the section name of the User Process
Instance Section in the QAT configuration files. For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1"><span class="nb">export</span><span class="w"> </span><span class="nv">QAT_SECTION_NAME</span><span class="o">=</span>CEPH</span>
</pre></div></div><p><strong>For in-tree QAT</strong></p>
<p>For in-tree QAT, ensure that your system meets the <a class="reference external" href="https://intel.github.io/quickassist/qatlib/requirements.html">QATlib System
Requirements</a>.  QATlib can be installed from pre-built packages or from
source code.  See <a class="reference external" href="https://intel.github.io/quickassist/qatlib/install.html">QATlib Installation</a> . After QATlib is installed, you
can run <code class="docutils literal notranslate"><span class="pre">cpa_sample_code</span></code> to check if the QAT environment is OK.</p>
<p>If you are using QATlib source code, the Ceph <cite>cmake</cite> build enables the
qatlib and qatzip options by default. Our normal compilation
already includes QAT-compressor-related code.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">./do_cmake.sh</span>
</pre></div></div><p>If you are using pre-built packages installed on the system, the following
CMake options must be configured when building Ceph:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">./do_cmake.sh<span class="w"> </span>-DWITH_SYSTEM_QATLIB<span class="o">=</span>ON<span class="w"> </span>-DWITH_SYSTEM_QATZIP<span class="o">=</span>ON</span>
</pre></div></div><p><strong>For both out-of-tree QAT and in-tree QAT</strong></p>
<p>Edit Ceph’s central config DB or configuration file (usually <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code>) to enable QAT
support for <em>zlib</em> compression:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qat</span> <span class="n">compressor</span> <span class="n">enabled</span><span class="o">=</span><span class="n">true</span>
</pre></div>
</div>
<p>Set the RGW compression method:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1"><span class="c1"># for storage class(STANDARD)</span></span>
<span class="prompt1">radosgw-admin<span class="w"> </span>zone<span class="w"> </span>placement<span class="w"> </span>modify<span class="w"> </span>--rgw-zone<span class="o">=</span>default<span class="w"> </span>--placement-id<span class="o">=</span>default-placement<span class="w"> </span>--compression<span class="o">=</span>zlib</span>
<span class="prompt1"><span class="c1"># or create a new storage class(COLD) and define data pool(default.rgw.cold.data)</span></span>
<span class="prompt1">radosgw-admin<span class="w"> </span>zonegroup<span class="w"> </span>placement<span class="w"> </span>add<span class="w"> </span>--rgw-zonegroup<span class="w"> </span>default<span class="w"> </span>--placement-id<span class="w"> </span>default-placement<span class="w"> </span>--storage-class<span class="w"> </span>COLD</span>
<span class="prompt1">radosgw-admin<span class="w"> </span>zone<span class="w"> </span>placement<span class="w"> </span>add<span class="w"> </span>--rgw-zone<span class="w"> </span>default<span class="w"> </span>--placement-id<span class="w"> </span>default-placement<span class="w"> </span>--storage-class<span class="w"> </span>COLD<span class="w"> </span>--compression<span class="w"> </span>zlib<span class="w"> </span>--data-pool<span class="w"> </span>default.rgw.cold.data</span>
</pre></div></div></li>
</ol>
</section>
<section id="config-reference">
<h2>CONFIG REFERENCE<a class="headerlink" href="#config-reference" title="Permalink to this heading"></a></h2>
<p>The following QAT-related settings can be added to the Ceph configuration file
(usually <cite>ceph.conf</cite>) under the <code class="docutils literal notranslate"><span class="pre">[client.rgw.{instance-name}]</span></code> section.</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-qat_compressor_session_max_number">
<span class="sig-name descname"><span class="pre">qat_compressor_session_max_number</span></span><a class="headerlink" href="#confval-qat_compressor_session_max_number" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Set the maximum number of session within Qatzip when using QAT
compressor</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">256</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-qat_compressor_busy_polling">
<span class="sig-name descname"><span class="pre">qat_compressor_busy_polling</span></span><a class="headerlink" href="#confval-qat_compressor_busy_polling" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Set QAT busy bolling to reduce latency at the cost of potentially
increasing CPU usage</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../../man/8/radosgw-admin/" class="btn btn-neutral float-left" title="radosgw-admin -- rados REST 网关的用户管理工具" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../s3select/" class="btn btn-neutral float-right" title="Ceph s3 select" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>